# 作   者：要努力，努力，再努力
# 开发日期：2022/4/23 16:58
a = 20
b = 100
c = a + b  # 两个整数类型的相加操作
d = a.__add__(b)


print(c)
print(d)


class Student:
    def __init__(self, name):
        self.name = name

    def __add__(self, other):
        return self.name + other.name

    def __len__(self):
        return len(self.name)

stu1 = Student('张三')
stu2 = Student('里斯')

s = stu1 + stu2  #  TypeError: unsupported operand type(s) for +: 'Student' and 'Student'
print(s)

s = stu1.__add__(stu2)
print(s)


print('----------------------------------------------')
lst = [11, 22, 33, 44]
print(len(lst))  # len是内置函数
print(lst.__len__())
print(len(stu1))








